/**
 * Copyright &copy; 2012-2016 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> All rights reserved.
 */
package com.thinkgem.jeesite.modules.front.service;

import java.util.List;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.thinkgem.jeesite.common.service.TreeService;
import com.thinkgem.jeesite.common.utils.StringUtils;
import com.thinkgem.jeesite.modules.front.entity.Region;
import com.thinkgem.jeesite.modules.front.dao.RegionDao;

/**
 * 区域管理Service
 * @author 朱俊吉
 * @version 2017-11-27
 */
@Service
@Transactional(readOnly = true)
public class RegionService extends TreeService<RegionDao, Region> {

	public Region get(String id) {
		return super.get(id);
	}
	
	public List<Region> findList(Region region) {
		if (StringUtils.isNotBlank(region.getParentIds())){
			region.setParentIds(","+region.getParentIds()+",");
		}
		return super.findList(region);
	}
	
	@Transactional(readOnly = false)
	public void save(Region region) {
		super.save(region);
	}
	
	@Transactional(readOnly = false)
	public void delete(Region region) {
		super.delete(region);
	}
	
}